Fixes to make it work on linux