Another correction to isScalar function. The variable types in SymPy are tricky.