Added logging and fixed file transfer bugs