Bug fix for QR generation