fix for support xref field type in aggregates
Fix compile errors
Merge pull request #1292 from dennishendriksen/master

Fix compiler errors