optimizations and fixes to multiline.