Work around SMF's inconsistent use of INSTR

Sometimes, it acts as if it should be returning a boolean, sometimes
it's compared to 0 to make it a boolean. Let's just make those queries
sensible, shall we?