Improved $length tracking. Gained 10% speed.