fix SafeCopy generation