Closes #581. Only instantiate objects with same type
Merge pull request #599 from caelum/ot-iogiwithsametype

Closes #581. Only instantiate objects with same type