Various bugfixes. Fixed cut/copy/paste behavior, kludged together a newline fix...