bz19972: Fix items getting removed from the list

One of the changes I made caused the behavior that janet describes in
comment #4.  Reverting that part and updating the unittests.