Minor bug fixes

Change-Id: Icd772f092be1cf00908b15f9f8a3b2d478bec4be