Don't reset profiles before calling endQuery.
MaxProfiles caps list size rather than clearing.