Changes to compile on Mono/Linux

You should test them on windows first (they should work).
I have NOT tested them on windows myself.