Bug fixes for new ranking logic