Fixing bugs in Chart API