Seeing your code, you seem to use arrays sometimes with zero-based indices (from 0 to Array.Length - 1), and sometimes with one-based indices (from 1 to Array.Length).
I think this inconsistency is the source of your problem.
In VB, you can define whether you want to use zero-based or one-based arrays.
This may look like:
Option Base [0 | 1]
By default, Option Base 0 is active.
You should stick to a given mode (zero-based or one-based), and not mix both modes in the same module.
IMHO, best option is to use the default (0-based).