Fixed a few things to make it work on linux