Fixing a "del" bug

  and adding a test for it