Minor structural improvements to input parsing.