Fixing FileNotFoundException resolving relative paths incorrectly

Instead of using the current work directory, the file's own directory
was used instead.