Fix sign error in score function