Added osx (and probably linux) compatability.