Added ndim check to subtensor.