Fixed a bug where unions were unable to match the first query source with the returned records.