fix indent output and add some tests for it.