Correctly pass ownership of MemoryBuffers.