Fixed some handling in joinRoom and leaveRoom.
Fixed a number of jsDoc issues.