support relative paths in input and fixes bug with flattening of output dir structure