osx: Various build fixes