Fix bug with path resolution when plugin references contain plugin refs themselves