Fix issue 3738

As mentioned at https://code.google.com/p/sympy/issues/detail?id=3738.