Fixes issues with indexing into buffers.