Added fix for null values when flattening json objects