Fixed scope_for_rebuild, NULL values cannot be compared with SQL = operator.