@ShadTech as stated in previous posts, without a program source its hard to tell what goes wrong.
Array error:
' Declare and initialize an integer array
Dim intArray(5) As Int ' <==== Range 0 - 4
intArray = Array As Int(1, 2, 3, 4, 5)
' Access array elements
Log(intArray(0)) ' Outputs: 1
Log(intArray(4)) ' Outputs: 5
' Request 5 is greater then end range 4
Log(intArray(5)) ' Outputs: Error because the requested value is outside the specified range
Just put a breakpoint in a few places and see how far the program runs and pay attention to the behavior when using Array variable. Also check if you actually call all routines.