Fix safe_format