Fix for issue #1

I don't know all use cases of this particular trimming, but at least stripping not output directory, but input directory from filename made the output filename correct in my case.