Fixed StackOverflow due to Parameter References.

If you defined the same parameter twice as a reference on the same
project, a stack-overflow occurred. This is now fixed by checking
for who owns that field and ignoring all locally-defined fields
as possible parents.