Switch sympy matrix to scipy + minor changes