osx restored and other fixes