loader: Fix issue passing wrong instance if layer wraps instances

Change-Id: Iafd0f7dc3e4a911b165d3df1dadddf4d45fbef10
2 files changed