Fix incorrect output path when input file refers to other files
Merge pull request #22 from kotas/issues/21

Fix incorrect output path when input file refers to other files