compilation fixes for OSX