Changes for compilation on osx