Reorders val declarations to fix init problem

Fixes #1001784