Fixing bug with score ordering in ranking