Seems to work however if the `==` comparisons are replaced by `isIdentical`.