Fix the data gathering loop.