Improvements to the puppet snippets by Nikola Petrov.