Added DISTINCT to UNION queries.