minor fix to key generation