Hello Simon,
To achieve an exact 20 kHz PWM frequency, I think you will need to set the counter modulo register to 0x63. With your current value of 0x64, timer overflow will actually occur every 101 bus cycles, and this would account for the frequency error.
With the adjusted modulo value, the normal range of PWM values would be 1 through to 99, with special control arrangements required to achieve 0 percent and 100 percent duty cycle.
Regards,
Mac