Handle missing data elements better.
fix NPE.