Find path in case we're outside the directory.

Not completely tested, but should work.