Fix pkg upgrade