A pile of build fixes.