Bug fixes.

Change-Id: Ib5372bfe729c7406e4f9e03d391c7d3dcaffa0b5