Fix refList bugs with nested paths

prevRests should probably be removed entirely
Merge branch 'refList-bug'