Fix create_key() for Py3