Minor updates to legend and graph code