Mac build fixes

These are the collected fixes I needed to make to get Gaffer building on the Mac.