Fixes to make the program compile and run under Linux.

Before, this was only tested under OS X.