Many fixes after testing pkgr on gitlab.