fdo#72037: Fix comparison of indexOf values after string conversion.

regression from 9daa4f31944e1b9510b092ab9fdd433984c85d10

Change-Id: I369a9a342984084f5269bcd9d829c42de9ac4a23
(cherry picked from commit 088756cb2d67442f7d422ca064ab1dcdb410411f)
Fix another string conversion regression.

Change-Id: I8297fd60b7db057504260a2304ccce6358bb9776
(cherry picked from commit a3f3fd00e4fb6beb70284902791ef9cbc3318659)