Bug fixes.

Change-Id: I5de9b4807f0da3d2058dbf437d80e3ec6cd71b5b