Fix excessive memory allocations in loop().