make it work on Ubuntu

Basically all changes were to make it work on Ubuntu