Minor changes for OSX, needs better cross-platform support