Fixed a number of build errors.