Restore the safe_id() function.