Fixed faulty qr calls and additional output arguments of sparf.