Add error checking to genKeys, now creates generic file for invalid
keys.