Fix incorrect logic for param count.