Fix errors and disconnections