Reenable ranked relevance, fix various issues with it