Added validation check for parallelizing a seq

This fixes a bug where in a Seq can be converted into a RDD with partitions more than the number of elements it has. 

Also fixes the bug in the handling of the NumericRange.