Fixed an infinite loop when calling getInputLine