Made a few changes to get it to build in Ubuntu