ToJason funtion getNext() now does not throw exceptions.