Fixed erasing bugs