Fixed some cp and rm bugs