Fixed problem with order of variable declarations.