Bugfixes for OS X