HACK: only consider integer dimensions.

Fractional dimensions were causing stack overflows.