Fixed reference to field instead of local
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.