improve portability to Mac OS X