Fixing tests on windows

Tests were very broken on windows. This fixes that. I'm too lazy to try this out in a VM, so I'll let Travis take over from here...

Please scrutinize, I only have half an idea what I'm doing. ;)