Fix matrix_rank for empty matrices
#2853
+50
−7
Draft