fixed some issues with chart generation