It is necessary to keep track of whether we are at the end of the path
or not. This way we know whether to create an empty clone of the target
or to just use the direct directly.

It is also necessary to update the 'up' and 'tail' pointers when
descending through lists.

This fixes the issue seen in #8 and also passes all the existing tests.

Fixes #8