Fixed bug in _calc_score.