Fix ensureBufferObject