Replaced Counter in plotgroups for compatibility with Python <2.7