Fix attempted equality check of strings and other types