bug fixes for center of mass and viscosity

Please enter the commit message for your changes. Lines starting