Fix integer narrowing warnings in tests.