Fix small regressions after removing GadgetTemplate.js