Fix warnings

This fixes a few warnings that have accumulated in the code.
That's good.  Additionally we should really assert that each element of `cartdims` is strictly positive--not just that the product is positive.