Added tests for different modes of qr function and a crash test for A_Xinv_b function.