Fixed bug when calculating the accuracy