Fixed signature version 3 calculation

Tested and working fine with both version 2 and version 3 now