Update debugging messages a bit. Fix a bug in the signature function.