Fixes to nesting logic and using NewLine.Length instead of static 1.