More correct handling of pasted content