A few code cleanups for public key and public key testing