Fixed variable scope in functions
Replaced Gui_a and GuiControlGet

with appropriate functions from Gui.ahk