Fixed some errors and comments in algorithms