Replaced == into ===
Used constants for node types.