Fix crash do to use of undefined variable.