Fix SQL-fail: must consider NULLs when using not-equal-to (!=)