What is the final test of these three doing? It seems to index into path based on key's length, which looks like it could be a bug.