Fix Metadata.clone for Python 3