Fix bug in create_shared_key()