Output path respects the hierarchy of the input file. #297