Fixes for visual studio compiler