merged encryption patch from RC_0_16
fix error handling when directories in the target are missing
fixed error handling of missing directories in download path
revert mistake