Add error checking to int32 conversion