Fix order-of-evaluation bug in cartographer/infer