Fix in GraphNavigator for serialization of polymorphic interfaces

The fix needs to be extended to work with interfaces too.