Fixed bug in accuracy calculation.