fix minor bugs with smudge script