Minor changes to run on OS X as well