Remove trailing </script> from group template