Set error on package installation if package is not an object

Set error on package installation if package is not an object e.g. invalid handle