Fix undefined name errors.