Some optimization of loops in translation functions.