Clarify the cloning algorithm. Fixes three bugs.

https://www.w3.org/Bugs/Public/show_bug.cgi?id=22512
https://www.w3.org/Bugs/Public/show_bug.cgi?id=22513
https://www.w3.org/Bugs/Public/show_bug.cgi?id=22514