bug fixes and various improvements for file transfer