Fixed UNION counting issues