Added null checks to join/leave.