.osx: merged changes from upstream