Set buffers to exact length used by Mohsen.