Added type checking.