dsa: debug output, logic fixes