Add a default implementation for from_dict.