fixed some bugs.

Signed-off-by: TomWu <phperwuhan@gmail.com>