fix attribute copying (issue #878)