fixing two bugs related to loading packages