Better error handling in the GUI