Fixed most of the compiler warnings