NaN & null should be treated as 0 in dimension()
When dimension() receives a NaN or null value for the number, it will
treat it as zero.
Updated tests to reflect that as well.