Small changes to compile under OSX