Fix bug in input handling. Disable stdin when max_inputs is set to 0