fix a few file transfer bugs