add boundary tests for int64_t
fix boundary handling of int64_t