Fix for files opened not in the the current dir.

Fix issue #1