more OSX fixes from chaubold