Add error-checking for not present node in graph

Also included unit tests for not present node in graph