Fixed shallow copy bug