Add fallback dimension calculations since baseVal throws an error if not defined.