                     if b is 0
                         @rawSocket.removeListener('data', handshake_callback)
 
-                        status_buf = bufferSlice(@buffer, 0, i)
-                        @buffer = bufferSlice(@buffer, i)
+                        status_buf = @buffer.slice(0, i)
+                        @buffer = @buffer.slice(i + 1)
                         status_str = String.fromCharCode.apply(null, new Uint8Array status_buf)
 
                         handshake_complete = true

            @_processResponse response

            # For some reason, Arraybuffer.slice is not in my version of node
            @buffer = bufferSlice @buffer, (4 + responseLength)

    mkAtom = (response) -> DatumTerm::deconstruct response.getResponse 0


    view.set new Uint8Array(buf2), buf1.byteLength
    view.buffer

toArrayBuffer = (node_buffer) ->
    # Convert from node buffer to array buffer
    arr = new Uint8Array new ArrayBuffer node_buffer.length
