Minor bugs fixed in Algo.cs