Merge "Fix another set of bugs." am: af6a262020
am: df04d3bc93

Change-Id: I7aed878b670ef47f579057485217cb87187701cc