Fix a bug with inference