Make sure legends do not repeat - bring code into line with E77