Bug fix related to sorting by score