Fixed up function inference method.