[ard] Fix format extraction (fixes #3006 and #3032)