Add better support for node.
Improve the maching to better handle null and undefined.