Issue with sorting items

This is a try to fix the `INSERT_AFTER_START`sorting.

Comments are welcome.