Fix for ClassCastException with polymorphic middle binding
Merge pull request #102 from rustyx/master

Fix for issue #97: ClassCastException with polymorphic middle binding