Bugfixes in inference.