Fix some warnings on windows

-Also two potential bugs (FormatMessageW with char*)