Fix error generation, chart generation routines