Fixed divide by zero error in setting frequency.
Merge pull request #479 from CorruptedHeart/SetFrequencyFix

Fixed divide by zero error in setting frequency.