Fixes to compile on Mac OSX again