fixing merge bugs and adding ArrayBuffer unit tests