Fixed logic bug in deleting tiles