Fixed previous commit.

Variables were declared in the wrong scope.