added line and val cap fix
Merge branch 'debtcalc' into testing