Serial port fixes and GUI refactoring