Added a type check.