Fix app variable scope.