Preliminary fix to compile 3.1.1 on Mac OS X