Fix keyGen