Added try/catch blocks around restoreSelection selection calls.