fix bugs found just by trying the existing test driver