Fix error handling, settings dialogs and simulation.