Fixes issue #585
Reordering initializations