Fix.paste opts

This is just a carbon copy of the pull request #269 with one additional commit that fixed the selection test in pubic api.