Avoid integer overflow when dealing with very large systems