Test and Fix #1168. Add test to prove issue with inDoc. Add check for node in inDoc

Node::inDoc wasn't checking if the node existed before it accessed a property on it. This caused an error when Node was no longer bound to a node. This fix adds a check for the node.

Fix Issue #1168

Ping @msweeney

- [ ] Test
- [ ] Code Fix
- [ ] History 
- [ ] Sign Off or 3 days