Fix in-place sort() issues by copying array inputs