Fix bugs

Change-Id: I15386a7d317e042f470cc5abba6d8bfdeb9eaa55