Improve input checks.