Better handling of output directory (issue 15)