Fix GCC build.
Fix MSVC build.
Removed unused function.
Disable more warnings.