fixes to compile and run under OSX 10.9.1