Fix compatibility for OSX 10.7