Better cloning of nodes with save of the context. Fixes #715, #974, #1097, #1231, #1400