Fix for manual and auto post-processing (global name 'dirName' is not defined).

Changing only line 2257 as I stated as a manual fix in issue #58 did not fix auto post-processing. This one fixes both.