Fixups for dict ordering and min/max in UniformSample.