Fix mkpkg function