Fix equals
Add deadlock test