Fix in the legend editor 

See #370 and #371