CRM-13793 cleanup - assignment in condition, changed to test for equality

Note that this PR changes behaviour, and seems to be a bug fix.