Fixed #264

* Upon deleting a template, the connected blocks will be deleted as well