Ensure required node attributes exist before trying to use them

Fixes issue #1 whereby nodes that are missing required attributes cause an unhandled exception