Fixing bugs uncovered by TDTM test assertion.