Misplaced variable initialization