various bugfixes for osx