Fixing insertion sort