The template code uses .Count for the upper bound of the for loop.
eg.
For $INDEX$ As Integer = 0 To $LIST$.Count
Dim $ELEM$ As $TYPE$ = $LIST$($INDEX$)
$END$
Next
This is incorrect - it should use .Count -1
eg. the following code used the template, and throws an ArgumentOutOfRangeException
Dim list As New List(Of String)
list.Add("fred")
For i As Integer = 0 To list.Count
Dim s As String = list
Next