Add guards for local int look ups.  Correct consants.