Mac OSX fixes