Fix declaration-after-statement warnings