Merge of transfer file code from 2.2, fix for readbraw.