Minor modifications to function FloydWarshall()