Change __eq__method to __cmp__ to fix object comparisons