Fixed followup bug in output.cpp where iterator incrementation happened although the iterator was already placed on the next element.

Thanks to Robert Nagy for reporting the original bug and spotting the followup bug.