Fix #311 for unsuccessful inference steps