Fixed comparisons; now only the last one is valid in the db.