Fix bug in inference case too.