Excellent catches. Yes, I program on a widescreen so sorry about the funky, hard to read output. Is there a way to change that in my account settings?
Also, using warnings helped a bit. It showed a bunch of problems that were solved by simply putting "my" infront of a few variables. I'm running the program right now to see if it runs into the same error. I'll let you know if it continues, but when I run the program it can take a while before it runs out of memory.