fix some bugs

Change-Id: I15e562955cd22ab54b226f89be41910744f1c4c6