Fixed insertion sort issues