Properly handle relative links from a directory. Fixes #38