made sure it builds on msvc 12.0
some fixes for msvc 12