Fix counting of centuries and millennia.

Bug: 64742
Bug: 70935
Change-Id: Ia1692d12411af42376fbd0042790e9c725574d11
Merge "Fix counting of centuries and millennia."