From Lorenz Shori <lorenz.schori@gmx.ch>: Mac OSX fixes