Cleanup, and some GUI stuff.