Cleanup of the previous commit (with these changes, now correctly handles
where we are getting a matching node by Hardware ID but no matching node
was found; also includes updates a few variable names and additional comments
to make the code easier to follow)