gui port and some minor tweaks