small fixes in algorithms