Minor tweak to plugin so that it will work if someone specifies a container for legend.