BUG: Fixed issue 3504, and added tests for complex support