
Some of the loop control variables are global. This as expected has lead to corruption of their values, and produced undesired results. Fix this issue by setting the scope of these variables to local. Closes Bug: #1523348 Change-Id: I0f5676c5a0b97d3e027a1e7677b4b5a21470913b