BUG: Fixed issue 3504, and added tests for complex support
Merge pull request #4336 from Sankarshan-Mudkavi/fix-issue-3504

Fixed issue 3504