Fixed Bugs in Chart handling