clean up and bug fix.

Signed-off-by: lizhizhou <lzz@meteroi.com>