Fix problem where names leek out of scope. Fixes #29