Fixed an error with the delete function to make it repaint everything correctly.