Fixed duplicate global variables