Support for replacing buffer contents and respect narrowing