Fixed pagerank algorithm and corresponding tests.