Rectify various build errors