Fix crashes with null fields. Closes #35