Fixed compilation for Mac OSX