Undefined variable reference bug fix.