Added check_type() method.