Several deletion bugs fixed