Fix all warnings and optimize code

Signed-off-by: Harry Chen <373685963@qq.com>
Merge remote-tracking branch 'origin/master'