fixes to run on osx