Improved bash, plaintext, handlebars, puppet, scope fixes