Fix assertion when deleting the last section