Fixed some bugs and added more tests to cover them, also added deep copy to Canfield