Fix key generation.