Fixing illegal argument exception.