fixed all warning via compile and test.

pls merge this.