Solved some issues with non-square, incomplete or undefined matrixes, seems to work fine