Move stacking to metadata and don't modify data.

Close #868.