The move_later_prefix variable was reset to zero on each loop iteration, and thus the move_later entry (if any) was not added right after changing to another syspath prefix, but rather after exiting the enumeration loop.