Removed expensive indexing from memory transfer.