Fix allow null logic to also allow undefined