Added input type check.