New functions for freeing public and private keys. Remove bad type name