Additional fix for DISTINCT/OFFSET bug