Fixed another small bug with loop output