This reverts commit cab8dda9. I mistakenly thought that CAPI/ir.c failure was unrelated to this change. Need to debug it.