Fixed a few runtime errors.