[BUGFIX] Sorting of packages by dependency