Revert r30571.
Minor update to r30430: put the variables at the top of the function
instead of making an inner block.

Refs #4185