Better temporaries, slices and index handling