Make toArrayBuffer() test more robust