Fix bug in cartographer.infer