Logic error for equals and added a bit more testing.