Variable and Math fixes

LOOPCOUNTER Variable init incorrect

LOOPCOUNTER Maths do not work.