BUG: Fix for cov() with complex input

Closes #597 and #2680