Added ndim check to subtensor.

Minor change