Fixing legend problem.