Fixes for insert sort, unit tests