Fix bug on actions.copy and actions.directory encoding setting (issue #166)

Proposed fix to issue #166.