Adding rank of a matrix

there's an issue with a function that returns the rank of a random matrix?