Fix for larger matrix