Fix equality check on states