Fixed lots of MSVC and GCC compiler warnings