handle nil cases in QR and extend PLUDecomposition protocol