Bugfixes, GUI work, cleanup.