Fixed return of references from getComponent and return of references in querygen