Added check for empty rows and dicts.