Fixed divide by zero error in setting frequency.