OS X bugfixes/improvements