Fixing issue #4902.

closes #4902, Added a check for complex numbers.