Fixed some global variables