Hi I think substring occurs error when TO is longer than its content. This patch will fix the substring bug in epa-file-insert-file-contents. The last commit this line was 2008, so no one seems not using it, though ;) Thanks,