Fix compatibility for OSX.