Linux port

Changes made to get it working on my linux setup.