Modification to work on Mac OS X