Add more debug info and better error control, from Elrond.