key gen fixes
more tests