Fix circular reference / stack overflow issue