Correctly duplicate buffer