Fix slicing bug