added tests and fixed a bug in arraybuffers util