replace auto with iterator type (C++03 fix)
Remove extra text.clear