improved handling of empty input/output lists