Fixed some global variable issues that were casuing the program to not compile