Fixes to compile on Mac