minor debugging in two algorithms