Bugfix for legend, now accepts generic legend field