Trying to fix recursive calculation of mass inverse matrix