MacOSX fixes