Fix OSX bug