fix some warings
remove unneeded codes
Merge pull request #1910 from minggo/master

fix some warnings