Added ability to validate nodes and fixed the memoization of arguments