Improved legend robustness