Improvement on previous patch for generators, removes manual counter in favour of counting the number of child elements appended to the message element.