Package detection fix (#1574)