Fixed two bugs related to connecting and disconnecting users