Fixed bug in transfer query.