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
I just start using your way of naming it... for me it hurts writing those weird names... even on Linux writing C++ native code it hurts me :D