macOSX compatibility

3 files, minor changes. I think it might fix for many osx.