Added handling of ties in scoring.