fix: StackOverflowError for singleton scope

Hi,

Fixes Issue #770 by splitting constructor and initialization for singletons.