Fixed minor bugs.
Added tests for guis.