issue #178: fixed unsafe == comparisons