Added weird optimizations for input.