bug found in core, wiring_digital.c, function turnOffPWM(uint8_t timer)

I'd agree its a bug, and your fix is right