Related to ref #1069

Creates the output dir if it not exists.