Added trimming of indentation where appropriate