Fixed runtime errors.