Moved the 'ResizeBuffer' command here. I also moved the 'CopyData' argument.