more build fixes from messy merge