fix several problem

Change-Id: Ib5798fec3a4d37e2e152fe42b62916e03205c8f6
(cherry picked from commit db61578a0b36394f96f7260ab83775d9a3157ac6)