Added some more test cases for short-circuiting the shelf when
a reference node is in the parent path.