Fix GUI code