Doubled length value and added check if both values are the same which i...

...s unlikely to happen for wrong or broken packages

Probably fixes #2705
nope, there is the QuickMath class now; this is a left-over I missed.