Fixed occasional algorithm bug.