Fix bug when check the type of input.