Fix the behavior of Array.reverse