Add debug
Adjust logging; distinctify records
Fix indentation
Adjust logging
Correct lookup substitutions