Fixed crash on OSX.