multiple bugfixes, to text and debugger