Added test cases for edge case rank queries.