fixed Mac OS X compilation