Fix OSX compatibility