Fix generation of summary plots, add a test for it