Small bug fix for tone detection