Fix freeze constraint in case some DOFs are disabled