Fixing bugs: different transfer function calls for read, switch done function, depending on read/write.