Fixing tests on windows

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