Fixed a small bug in the qmg422 code