fix rewrite tests under Windows

loads of tests failing under windows :(
@jlundell : take a look at this