Generator cleanup. Fixes #55