Fixed calculation of signatures for version 3.