Fix header issues with MSVC debug builds
Merge remote-tracking branch 'upstream/master' into travis-osx