Fixed app registry lookup function to find an app by type to ensure that all returned apps are present in the supplied session object.