Fix compatiblity with the latest sympy version (git).