Removed extra == method and simplified remaining one. Added tests.