Improvements to legend