Fix bug in input test which was due to my bad usage of iterator.