fixed nullpointerexception in deepCopy
tentative test, still needs more probably