Backport mapper fixes

Fixes 90% of the failing tests for stable7 on windows

@DeepDiver1975 @LukasReschke @th3fallen