Improved validation of nodes