Fix a few issues pointed out by msvc