Replace the != operator with <> as the latter seems to work better.