bug fixes.  was using wrong key size