fix initial sort (and related problems) on encounters table [WG-2]