bug fix for v2 signature generation code