fix assertion in manual algo