fixes #95

Exit if the output path points to a folder
Exit if the output path point to an existing file
Merge remote-tracking branch 'origin/v2.x' into v3.x