Windows Hotfixes

This PR fixes some recently introduced Windows bugs.