Matlab client buffer write fix