Handle inheritance when determining mapping

For any object hierarchy the Single() call failed as there is more than one. I created a test case that demonstrates this this issue and confirms both the existing and modified case works.