bunch of build fixes