Add check to ensure frequency value is set to 0 when period counter hits maximum or minimum Closes #31