Fix MSVC warnings at the -W2 level