Better error logging when loading packages