Merge pull request #551 from jack-pappas/sgen-patch