legend and compare fixes