Fixes: #1922 Fixing errors in copypaste handler