Move undefined_param error check to enforce_params