fix pretty-print for records with duplicate fields