Fix buffer mappings.

(cherry picked from commit a41dc521ff98503cec21844e62abc89f9e77d92b)