fix testcase9 by fixing getTopLevelIndent, improve debugging support