Factored out and fixed the setting of param_types