Check for null leaf values when parsing JSON structures. Fixes #790