Fix issue where directories are assumed when a file is copied.

Issue #195