Small fixes to get working on Ubunutu.

A bunch of small fixes that get this working for me on Ubuntu.