Fix minor bugs making tests fail on Windows