imported fix for alignment bug from npRmpi