Fix range cache unittest by checking for KeyMax

I'll do that next time Matt.