Small changes for compilation on OSX
Windows needs a different function
Merge branch 'osx2' into color