Fixed a memory leak on 32bit platforms with native_long enabled and reading an INT64.
Fixed error code, and add a check for it to the test.

Code 1 was already meaning something else.