Fixed crash in key generation.

bibimbap used to crash at key generation time when the `year` field
contained anything fancier than just a year.