Fix issue where input type was not being detected properly