Added __hash__ to fix bug in Python3