Fix issues preventing build on Linux

I have fixed a few issues preventing build on other platforms than Windows. Did not actually check if there are any functional problems though...