Updated hosts and templates classes to fix the template mass_update, mass_add and mass_remove functions