Fix crash on MacOSX 10.7