Fixed iteration through timelines on local/global vars.

Just caught a bug with the local/global variable check. Essentially, the loop to check for "local/global var" inside a timeline was generating an out-of-bounds error because it was making an incorrect assumption about how timelines are stored.