Slightly more useful path handling.
Updated tests.