Fixed infinite loop in input try-catch.