MacOS build fixes