Added pie chart test and fixes