Adds basic input validation.