Use simpler undefined checks