A couple of fixes for windows