Fix non-sgen builds.

This commit licenced as MIT/X11.
Merge pull request #746 from madewokherd/sgenbuild

Fix non-sgen builds.