fixing bad test and bad key generation