Bugfix on ranking