Issue #8756 by tuj: Moved initialization around