Merge two sorted array bug fix