Fixed problem with NoSuchElementException.