Socket bug fixes and user leaving

Fixed bug in storage of races, fixed bug of users not being removed,
added user leaving.