Fixes for PDI-3813 - reference fields with null values caused a null pointer exception.
Merge remote-tracking branch 'malsmith/pdi-3813'