Fix bug with not zeroing out _parent, which can result in an infinite loop. Add unit test for this.