Fixed a few things to make this work on linux