.cxd dimension detection fixes (rebased onto develop)

Same as gh-367.