Update shell_sort/straight_insert_sort code for removing potential risk.