Fix contacts constraint free dof computation.