Fix for bug I introduced in pr 727.

Global variables are dangerous.