Fix potential undefined local variable.