Pass paramcount and CV instead of just CV

Oh, and this leaks and needs to be fixed