Fix for unwanted modification of original data while dumping
add test
Merge branch 'pr/1006' into devel

Fixes #1006