Fixed a few GUI bugs and made some of the base GUI code more flexible.