Fixed qr bug