Fix installation of packages with dots in pkg name

This commit fixes a regression which caused packages with dots in the
package name to fail to install. Resolves #8614.