Bug fix for the paste crasher (both regular and from clipboard).
Hopefully a better fix for the paste and clipboard paste crashers. Also a bit of reformatting of the indentation inside one of the functions that did not have consistent indentation. LATER: figure out why the front-end is not disabling options like paste at start-up.