Reorders val declarations to fix init problem

Fixes #1001784
Merge pull request #467 from skyluc/issue/initialization-fails-using-wizard-1001784

Reorders val declarations to fix init problem