Fix dialog and io