Fixed gui and figure window behavior