Bunch of build fixes