Fix legend being duplicated after a manual refresh.