Thank you for reporting,
There was a mistake in line
1435
if(! $this->db->insert(array("privateweb" => 1) , $sc, "id=$memId") )
Must be
if(! $this->db->update(array("privateweb" => 1) , $sc, "id=$memId") )
I updated the download link too.
----------------
About template problem, Susan is right, it is possible to have elements in same name in MODx, names can be changed in anytime but ID is unique, unchangable (in backend) and safer.
but if your input is template name, you can easily get template ID by template name like below:
<?php
$params['template'] = $modx->db->getVlaue($modx->db->select("id", $modx->getFullTableName("site_templates"), "templatename='$input_name'"));
Good luck