Fix bug when there are no packages installed

This really only affects core/init