Fixes #205, IndexError when using function setInput()