Fixed validity tests for integers.
Fixed validity tests for integers.

Previous change meant validation was always done for integers, even from
other integers. Change means validation is only done when previous integer
range is wider than required.

jongiddy/balcazapy,jongiddy/balcazapy,jongiddy/balcazapy