fixed bad dict iteration in format_system_metadata