Fix issues with ArrayBuffer