minor changes in buffer packing and fixed C++ mpi