lots of build fixes