Cleaned up error handling
Removed spurious headers in copy files phase