Fixes a type error when accessing node parent of a null object.

Fixes #19