Fixes to transfer.py