Can you assert that A.dtype==int64, s.dtype==int32 m.dtype==int32 as you do the other small change. Just an extra safety. It the tests was passing, I wouldn't botter with that.