MSVC 12 compatible

Plus very minor fixes