Fixed SF#3087619 (crash if leading indentation becomes too long).
Minor tidying.
Authored by: simonjwright 2010-10-20
Parent: [r74]
Child: [r76]