Merged in improvements to debug printing in readiness for db access nesting study