Fix more OSX bugs