Removed unused code; closed streams.

Closed file streams opened in copyFile.
Removed unused "int i" in a few methods.
Merge pull request #8 from bhauer/master

Resolved two warnings: unused code and resource leakage on streams.