Fix dangling references problem with sliced expressions