Fixed crash on Mac.