More OS X improvements

OS X improvements by MaddTheSane.