Some mac osx fixes

Quick fixes to compile on MacOS X