massive bugfix for osx and some other stuff fixed on the way as well