Corrected undefined check.