small fixes in file copy