Fix package calculation issue