More complete equality check for mixed types