Make Scope hashable
Handle str/bytes issues with lxml