Improving validation of input.