Add specific case in dump() for handling generic dictionaries