Fix incorrect assert, deletion bug