fixed various bugs in the generation of plots