fixed bug in appendCopy routine; updated tests