Fixed printing format, make it possible to store multiple snippets
with the same name.  Moved debug log statements to appropriate places.