Fix forward ref bug and percent calc.