Clean up and handle error.
Set the default group when switching user.