Fixing frequency register calculation.