Fixed minor runtime errors.