Fixes and cleanup in lobby; fix a couple logic bugs in server.