Fixed bugs in accuracy()