More bugfixes related to multiline handling