Fixes Issue 3780

This bug was introduced due to a really simple error by me. http://code.google.com/p/sympy/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Priority%20Milestone%20Reporter%20Summary%20Stars&groupby=&sort=&id=3780 . This PR hopefully resolves it.