fix segfault #19 in copy/modify

fixes #19