Fixed a bug in adding inertias