Fixed a lot of small bugs found by new warning message from compiler
Fixed warning messages in compiler