PAGERANK: Fixed graph generation bug and added self-checking step