Fixed crashing when erasing everything