Fix crash with smudge tool around the edges