Changed some type checks for Node compatibility.