Check if item responds to deepCopy before invoking deepCopy

Just a minor bugfix.