Fixed a potential error in touch input.