QR method: Fixed implementation and tests for non-symmetric matrices.