Fix pasting and focus.