fixes and improvements on barcode reading