Updated to compile on Ubuntu, fixed a number of warnings