Make converting null to i32 work correctly.
Copy improvements from contenttest.