Bugfix error reason when verifying integers

(Found when applying dialyzer to the generated code) The wrong error
reason could be raised for integers out of range.
Bugfix dialyzer issues