Make register and quit consistent in the server code