Fixes #205, IndexError when setInput() is called
Merge pull request #214 from mishravikas/fix_205

Fixes #205