Clean up line length, fix matrix error