Made an update to account for deleted small group nodes so that the join small group form does attempt to load for them.
Added an if statement to confirm the presence of the HTTP_USER_AGENT key to resolve a PHP error I noticed in the production logs.