A bunch of changes for the Linux-port

Untested code!!!