pasting support + bugfixes