fixed compilation by working around countUntil and replaceing a concrete ReturnType by auto