Fixed bug that occurred when pkgsite not specified

Fixes a bug introduced in #6405 where installing a package would fail if pkgsite was not specified.