Fixed the error in algorithm.hpp
Added test for for_each and for_each_n