Merge pull request #1905 from apache/abderrahim/type-checking

_pluginfactory: Additional type checking