lots of fixes for gui module