Old style type casts replaced.
FIXME resolved: chart type is now handled using the enum instead of int.
Consistent formatting