toJSON() improvments.