Update to equality check to deal with value types