Use full path of a variable, not just the name.
Revert back to using paths for scalars, use them correctly in the array definitions.
Use full path of dimension variables in array definitions