Fixed crash on load for Mac OSX