Fix corruption bug: Array slicing end is exclusive