Cured some memory leaks and got rid of copy constructor usage