Improve signal handling in the mainwindow and wizard