Fixes to get late compiling on OS X