fix some problems with ordering packages on alt. locations, #23189, #940