Add test to ensure behavior for matrices with sum between n and n^2 works