Fix bad rendering of error message, and fix test to support autogenerated barcodes.