handling of optional parameters when counting parameters.