Fixed detection of input and output type