add nodereference support, fixes #1