Fixed a bug while removing a package.