Further improvements on ID pasting