Fixed calculation for rule node depth.