Added basic dynamic type checking